<template>
  <div>
    <group v-for="item in hospitalList" :key="item.orgCode">
      <cell :title="item.hosName" :link="{path: '/register/dept/' + item.orgCode}">
        <div slot="inline-desc">
          <p>{{ item.address }}</p>
          <p>{{ hospitalLevel[item.level] }}</p>
        </div>
      </cell>
    </group>
  </div>
</template>

<script>
  import Group from 'vux/src/components/group/index'
  import Cell from 'vux/src/components/cell/index'

  export default {
    components: {
      Group,
      Cell
    },
    methods: {
      getHospitalList () {
        this.$vux.loading.show({
          text: 'Loading'
        })
        let url = 'https://ydt.xy12345.cn/edot/api/apoRe/getOrgan'
        let param = {
          queryType: 0,
          orgCode: ''
        }
        this.$axios.post(url, this.$qs.stringify(param)).then(response => {
          this.hospitalList = response.data.data.body
          this.$vux.loading.hide()
        })
      }
    },
    mounted () {
      this.getHospitalList()
    },
    data () {
      return {
        hospitalList: [],
        hospitalLevel: {
          13: '一级甲等',
          12: '一级乙等',
          11: '一级丙等',
          23: '二级甲等',
          22: '二级乙等',
          21: '二级丙等',
          34: '三级特等',
          33: '三级甲等',
          32: '三级乙等',
          31: '三级丙等'
        }
      }
    }
  }
</script>

<style scoped>

</style>
